//
//  ViewController.m
//  AdImage
//
//  Created by Burn on 2019/7/23.
//  Copyright © 2019 menksoft. All rights reserved.
//

#import "ViewController.h"
#import "AdView.h"
#import "Model.h"
#import <SDWebImage.h>
@interface ViewController ()


@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];

    CGRect rect = CGRectMake(0, 100, [UIScreen mainScreen].bounds.size.width, 200);
    AdView *adView = [[AdView alloc]initWithFrame:rect loadImage:^(UIImageView * _Nonnull imageView, NSURL * _Nonnull url) {
        [imageView sd_setImageWithURL:url];
    }];
    
    
    Model *m1 = [[Model alloc]init];
    m1.url = [NSURL URLWithString:@"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1563869952361&di=cb835bea1f1f0fef744187af68886d08&imgtype=0&src=http%3A%2F%2Fs1.sinaimg.cn%2Flarge%2F003d7pslzy73fi2mueX87"];
    m1.title = @"Ttile";
    
    Model *m2 = [[Model alloc]init];
    m2.url = [NSURL URLWithString:@"https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=2260836807,3289834018&fm=26&gp=0.jpg"];
    m2.title = @"Ttile";
    
    Model *m3 = [[Model alloc]init];
    m3.url = [NSURL URLWithString:@"https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=4001789523,931570957&fm=26&gp=0.jpg"];
    m3.title = @"Ttile";
    
    [adView setAdWith:@[m1,m2,m3]];
    [self.view addSubview:adView];
    
    

}

- (void)dealloc{
    NSLog(@"deallocViewController");
}



@end
